package com.example.month11.navigation;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.example.month11.navigation.navigationbar.DefaultNavigationBar;
import com.example.recyclerview01.R;

/**
 * Builder设计模式构建NavigationBar-(效果演示)
 */
public class NavHomeActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_nav_home);

        DefaultNavigationBar navigationBar = new DefaultNavigationBar
                // .Builder(this, findViewById(R.id.view_group))
                .Builder(this)
                .setTitle("今日标题")
                .setRightTitle("卧槽")
                .setRightClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Toast.makeText(NavHomeActivity.this, "click show", Toast.LENGTH_SHORT).show();
                    }
                })
                .builder();
    }
}